<!DOCTYPE html>
<!--[if lt IE 7]>      <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
<!--[if IE 7]>         <html class="no-js lt-ie9 lt-ie8"> <![endif]-->
<!--[if IE 8]>         <html class="no-js lt-ie9"> <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js"> <!--<![endif]-->
    <head>
        <meta charset="utf-8" />
        <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
        <title th:text="#{doResetPwpage.title}"></title>
        <meta name="description" content="" />
        <meta name="viewport" content="width=device-width, initial-scale=1.0" />

        <!-- Place favicon.ico and apple-touch-icon.png in the root directory -->
        
        <!--[if lte IE 9]><link rel="stylesheet" href="css/ie.css" type="text/css" media="screen" /><![endif]-->

		<link rel="stylesheet" href="css/css.css" th:href="@{/css/min.css}"/>            
        <script src="http://lib.sinaapp.com/js/jquery/1.9.0/jquery.min.js" th:src="@{http://lib.sinaapp.com/js/jquery/1.9.0/jquery.min.js}"></script>
        <script th:inline="javascript">/*<![CDATA[*/
        window.jQuery || document.write('<script src="'+ /*[[@{/js/vendor/jquery-1.9.0.min.js}]]*/ 'js/vendor/jquery-1.9.0.min.js'
        		+'"><\/script>')
        /*]]>*/</script>
        <script type="text/javascript" th:src="@{/js/econgen.js}"></script>
        <script type="text/javascript" th:inline="javascript">/*<![CDATA[*/
        function checkColumns(){
        	var hasError = false;
        	var err = $('.error-msg').html('');
        	var pw = $('#password').val();
        	if(pw == ''){
        		addErr(/*[[#{regpage.js.password.blank}]]*/''
        			);
        		hasError = true;
        	}
        	var cpw = $('#confirmPassword').val();
        	if(cpw == ''){
        		addErr(/*[[#{regpage.js.confirmpassword.blank}]]*/''
        			);
        		hasError = true;
        	}
        	if(cpw !== pw){
        		addErr(/*[[#{regpage.js.confirmpassword.valid}]]*/''
        			);
        		hasError = true;
        	}
        	if(hasError){
        		err.show();
        	}
        	return !hasError;
        }
        function addErr(errMsg){
        	$('.error-msg').append('<div>' + errMsg + '</div>');
        }
        /*]]>*/</script>
    </head>
    <body>
        <header th:substituteby="common/template::header"></header>
        
        <div class="container">
        	<div class="row" th:unless="${canReset}">
        		<h1 th:text="#{doResetPwpage.content.failed}"></h1>
        	</div>
        	<hr/>
        	<div class="row" th:if="${canReset}">
        		<div class="twelvecol top-border">
        			<h3 th:text="#{doResetPwpage.content.title}"></h3>
        			<div th:if="${msg}" class="error-msg" th:text="#{doResetPwpage.content.resetfailed}"></div>
        			<div class="form-reg">
		        		<form th:action="@{/resetPassword}" method="post">
		        			<input type="hidden" name="uid" th:value="${uuid}"/>
		        			<ul class="top-border-dot">
		        				<li class="sixcol">
       								<label><strong th:text="#{regpage.reg.username}"></strong><span class="required">*</span></label>
       								<input name="username" readonly="readonly" th:value="${username}"/>
       							</li>
       							<li class="sixcol last">
       							</li>
       							<li class="sixcol">
       								<label><strong th:text="#{regpage.reg.password}"></strong><span class="required">*</span></label>
       								<input type="password" name="password" id="password"/>
       							</li>
       							<li class="sixcol last">
       								<label><strong th:text="#{regpage.reg.confirmpassword}"></strong><span class="required">*</span></label>
       								<input type="password" name="confirmPassword" id="confirmPassword"/>
       							</li>
       							<li class="twelvecol">
       								<hr/>
       								<button class="form-btn" type="submit" onclick="return checkColumns()" th:text="#{doResetPwpage.content.confirm}"></button>
       								<hr/>
       							</li>
		        			</ul>
		        		</form>
	        		</div>
        		</div>
        	</div>
        </div>

        <footer th:substituteby="common/template::footer"></footer>
        
    </body>
</html>
